﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using IQKS.AWP.BusinessAccessLayer;
using IQKS.AWP.BusinessObject;

public partial class home_DashBoard1 : System.Web.UI.Page
{

    protected void Page_Load(object sender, EventArgs e)
    {
      if(!IsPostBack)
      { 
         //Guid gudUserID = new Guid("8B551132-48EC-43DE-9C9E-1D389A8EBA99");         
        GetData(CommonUtility.GetLoggedOnUserId());
      } 
    }

    private void GetData(Guid UserId)
    {
        DataSet objDs;
        string strUserRole = CommonUtility.GetCurrentUserRole();
        objDs = new UserMasterBAL().GetStatusDashboard(UserId);
        if (strUserRole == "CANM" || strUserRole == "CANB" || strUserRole == "CANR")
        {
            gvCandidateDetails.DataSource = objDs;
            gvCandidateDetails.DataBind();
        }
        else
        {
            gvRegistrationStatusDashboard.DataSource = objDs;
            gvRegistrationStatusDashboard.DataBind();
        }
       
       
    }

    protected void gvRegistrationStatusDashboard_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {

    }
    protected void gvRegistrationStatusDashboard_RowDataBound(object sender, GridViewRowEventArgs e)
    {


    }
    protected void gvRegistrationStatusDashboard_SelectedIndexChanged(object sender, EventArgs e)
    {
   

    }

    protected void gvCandidateDetails_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {

    }
    protected void gvCandidateDetails_RowDataBound(object sender, GridViewRowEventArgs e)
    {

    }
    protected void gvCandidateDetails_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
    protected void gvRegistrationStatusDashboard_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if(e.CommandName=="Details")
        {
            Session["StatusID"] = e.CommandArgument.ToString();
            Response.Redirect("~/home/CandidateStatus.aspx");
        }
    }
}